<template>
  <!-- v-if 就是等到拿到数据后才开始渲染，没有拿到数据的时候不渲染 -->
  <div class="article-detail-page" v-if="info">
    <nav class="nav">
      <span class="back" @click="$router.go(-1)">&lt;</span>
    </nav>
    <header class="header">
      <img src="../img/11.png" alt="" />
      <h1>{{ info.title }}</h1>
      <p>
        {{ info.desc }}
      </p>
      <p>
        <span>{{ info.price }}</span>
      </p>
      <p>哈哈哈哈哈哈哈哈哈哈</p>
    </header>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: 'finddetails',
  data() {
    return {
      info: null,
    }
  },
  async created() {
    const { data } = await axios({
      url: 'http://liufusong.top:8080/houses?cityId=AREA%7Cdbf46d32-7e76-1196&stat=1&end=10',
    })
    // console.log(data.body.list)
    this.info = data.body.list
  },
}
</script>

<style lang="less" scoped>
.article-detail-page {
  .nav {
    height: 44px;
    border-bottom: 1px solid hotpink;
    line-height: 44px;
    text-align: center;
    background-color: lightcyan;
    .back {
      font-size: 18px;
      color: #333;
      position: absolute;
      left: 10px;
      top: 0;
      transform: scale(1, 1.5);
    }
  }
  img {
    width: 100px;
    height: 100px;
    border: 1px solid #333;
  }
  .header {
    color: #333;
    font-size: 18px;
  }
}
</style>
